/*    */ package com.zimbra.cs.service.admin;
/*    */ 
/*    */ import com.zimbra.common.account.Key.CosBy;
/*    */ import com.zimbra.common.account.Key.DomainBy;
/*    */ import com.zimbra.common.service.ServiceException;
/*    */ import com.zimbra.common.soap.AdminConstants;
/*    */ import com.zimbra.common.soap.Element;
/*    */ import com.zimbra.cs.account.Provisioning;
/*    */ import com.zimbra.cs.account.accesscontrol.AdminRight;
/*    */ import com.zimbra.cs.account.accesscontrol.GranteeType;
/*    */ import com.zimbra.cs.account.accesscontrol.RightCommand;
/*    */ import com.zimbra.cs.account.accesscontrol.RightCommand.EffectiveRights;
/*    */ import com.zimbra.cs.account.accesscontrol.Rights.Admin;
/*    */ import com.zimbra.soap.ZimbraSoapContext;
/*    */ import com.zimbra.soap.admin.type.GranteeSelector.GranteeBy;
/*    */ import java.util.List;
/*    */ import java.util.Map;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public class GetCreateObjectAttrs
/*    */   extends RightDocumentHandler
/*    */ {
/*    */   public Element handle(Element request, Map<String, Object> context)
/*    */     throws ServiceException
/*    */   {
/* 38 */     ZimbraSoapContext zsc = getZimbraSoapContext(context);
/*    */     
/* 40 */     Element eTarget = request.getElement("target");
/* 41 */     String targetType = eTarget.getAttribute("type");
/*    */     
/* 43 */     Key.DomainBy domainBy = null;
/* 44 */     String domain = null;
/* 45 */     Element eDomain = request.getOptionalElement("domain");
/* 46 */     if (eDomain != null) {
/* 47 */       domainBy = Key.DomainBy.fromString(eDomain.getAttribute("by"));
/* 48 */       domain = eDomain.getText();
/*    */     }
/*    */     
/* 51 */     Key.CosBy cosBy = null;
/* 52 */     String cos = null;
/* 53 */     Element eCos = request.getOptionalElement("cos");
/* 54 */     if (eCos != null) {
/* 55 */       cosBy = Key.CosBy.fromString(eCos.getAttribute("by"));
/* 56 */       cos = eCos.getText();
/*    */     }
/*    */     
/* 59 */     GranteeSelector.GranteeBy granteeBy = GranteeSelector.GranteeBy.id;
/* 60 */     String grantee = zsc.getRequestedAccountId();
/*    */     
/* 62 */     if (!grantee.equals(zsc.getAuthtokenAccountId())) {
/* 63 */       checkCheckRightRight(zsc, GranteeType.GT_USER, granteeBy, grantee);
/*    */     }
/*    */     
/* 66 */     RightCommand.EffectiveRights er = RightCommand.getCreateObjectAttrs(Provisioning.getInstance(), targetType, domainBy, domain, cosBy, cos, granteeBy, grantee);
/*    */     
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/* 74 */     Element resp = zsc.createElement(AdminConstants.GET_CREATE_OBJECT_ATTRS_RESPONSE);
/* 75 */     er.toXML_getCreateObjectAttrs(resp);
/* 76 */     return resp;
/*    */   }
/*    */   
/*    */   public void docRights(List<AdminRight> relatedRights, List<String> notes)
/*    */   {
/* 81 */     relatedRights.add(Rights.Admin.R_checkRightUsr);
/*    */   }
/*    */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/cs/service/admin/GetCreateObjectAttrs.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */